package ATM;

public class Screen
{
	
	// it contains several methods for displaying information on the ATM screen
	
	private static Screen instance;    				// using Singleton pattern for class Screen
	
	private Screen(){}
	
	public static synchronized Screen getInstance()
	{
		if (instance == null)
			instance = new Screen();

		return instance;
	}
	
	public void displayMessage(String message)      // displays message without adding a new line
	{
		System.out.print(message);
	}
	
	public void displayMessageLine(String message) // displays message and adds a new line
	{
		System.out.println(message);
	}
	
	public void displayDollarAmount(double amount) // special  method used to displays amounts of $
	{
		System.out.printf("$%,.2f", amount);
	}
	
	public void displayAccountNumber(int accNumber)// special  method used to displays account numbers
	{
		System.out.printf("%d", accNumber);
	}
}
